csssection: Redo constructors
authorBenjamin Otte <otte@redhat.com>
Wed, 10 Apr 2019 01:51:40 +0000 (03:51 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 12 Apr 2019 17:34:28 +0000 (19:34 +0200)
Remove the unused one and rename the old one to new_from_parser().

gtk/gtkcssprovider.c
gtk/gtkcsssection.c
gtk/gtkcsssectionprivate.h

index 8f99c7957925eb60e33e1eba932016e10e081855..37e8338531ab4617751150b215bbb5a72b4e104b 100644 (file)
@@ -396,9 +396,9 @@ gtk_css_scanner_push_section (GtkCssScanner     *scanner,
 {
   GtkCssSection *section;
 
-  section = _gtk_css_section_new (scanner->section,
-                                  section_type,
-                                  scanner->parser);
+  section = gtk_css_section_new_for_parser (scanner->section,
+                                            section_type,
+                                            scanner->parser);
 
   if (scanner->section)
     gtk_css_section_unref (scanner->section);
index aab2e4f140883949c7c541974a6382887f148606..bb5a7116250ee2ea80c6c16ea0964cd4c66e7c54 100644 (file)
@@ -36,9 +36,9 @@ struct _GtkCssSection
 G_DEFINE_BOXED_TYPE (GtkCssSection, gtk_css_section, gtk_css_section_ref, gtk_css_section_unref)
 
 GtkCssSection *
-_gtk_css_section_new (GtkCssSection     *parent,
-                      GtkCssSectionType  type,
-                      GtkCssParser      *parser)
+gtk_css_section_new_for_parser (GtkCssSection     *parent,
+                                GtkCssSectionType  type,
+                                GtkCssParser      *parser)
 {
   GtkCssSection *section;
 
@@ -59,23 +59,6 @@ _gtk_css_section_new (GtkCssSection     *parent,
   return section;
 }
 
-GtkCssSection *
-_gtk_css_section_new_for_file (GtkCssSectionType  type,
-                               GFile             *file)
-{
-  GtkCssSection *section;
-
-  gtk_internal_return_val_if_fail (G_IS_FILE (file), NULL);
-
-  section = g_slice_new0 (GtkCssSection);
-
-  section->ref_count = 1;
-  section->section_type = type;
-  section->file = g_object_ref (file);
-
-  return section;
-}
-
 void
 _gtk_css_section_end (GtkCssSection *section)
 {
index d59188e8db37b8f8da1e7b2eb87feae4bbd01b0b..a028f20ecde208031e147fce9ecd417008075962 100644 (file)
 
 G_BEGIN_DECLS
 
-GtkCssSection *    _gtk_css_section_new                (GtkCssSection        *parent,
+GtkCssSection *    gtk_css_section_new_for_parser      (GtkCssSection        *parent,
                                                         GtkCssSectionType     type,
                                                         GtkCssParser         *parser);
-GtkCssSection *    _gtk_css_section_new_for_file       (GtkCssSectionType     type,
-                                                        GFile                *file);
 
 void               _gtk_css_section_end                (GtkCssSection        *section);